package com.firefighting.dao;

import java.util.HashMap;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.firefighting.entity.MaintenancePlan;
import com.firefighting.entity.MonthPlanInfo;
import com.firefighting.entity.SeasonPlanInfo;
import com.firefighting.entity.YearPlanInfo;

public interface MaintenancePlanMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(MaintenancePlan record);

    int insertSelective(MaintenancePlan record);

    MaintenancePlan selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(MaintenancePlan record);

    int updateByPrimaryKey(MaintenancePlan record);
    
    /*zhyan 查询维保计划数量列表*/
    @SuppressWarnings("rawtypes")
	List<HashMap> selectMaintenancePlanList();
    
    List<Integer> selectByContractId(Integer contractId);
    int deleteByContractId(int id);
    
    @SuppressWarnings("rawtypes")
	List<HashMap> selectPlanInfoByContractId(@Param("id") int id);
    /** zhyan 根据计划id查询该计划所在的合同id */
    int selectContractIdByPlanId(@Param("id") int id);
    
    /** zhyan 根据合同id列表查询维保计划列表 */
    @SuppressWarnings("rawtypes")
	List<HashMap> selectMaintenancePlanByContractIdList(@Param("list") List<Integer> list);
    
    /** zhyan 根据合同id列表查询月计划 */
    List<MonthPlanInfo> selectMonthPlanInfoListByContractIdList(@Param("list") List<Integer> list);
    
    /** zhyan 根据合同id列表查询季计划 */
    List<SeasonPlanInfo> selectSeasonPlanInfoListByContractIdList(@Param("list") List<Integer> list);
    
    /** zhyan 根据合同id列表查询年计划 */
    List<YearPlanInfo> selectYearPlanInfoListByContractIdList(@Param("list") List<Integer> list);
    
    /** zhyan 查询合同的年计划 */
    List<YearPlanInfo> selectYearPlanInfoList();
    
    /** zhyan 查询合同的季计划 */
    List<SeasonPlanInfo> selectSeasonPlanInfoList();
    
    /** zhyan 查询合同的月计划 */
    List<MonthPlanInfo> selectMonthPlanInfoList();
    
  //Hanjd 查询计划中维保项目列表
    List<HashMap<String, Object>>selectMaintenanceList(@Param("id")Integer id,@Param("buildingId")Integer buildingId);
    
    //Hanjd 按建筑搜索计划中已下发维保项目列表
    List<HashMap<String, Object>> selectBuildingAlreadyMaintenanceList(@Param("id")Integer id,@Param("buildingId")Integer buildingId);
    //Liuxc 查询计划id
	int selectIdByTypeAndExcuteTime(@Param("type") int type, @Param("planExcuteTime") String planExcuteTime, @Param("contractId")int contractId);
	
    
}